<template>
  <span>
    <icon-svg v-if="trackNo"
              :iconName="iconName" />
    <!-- <el-button v-if="isDevice"
               type="text"
               @click="toTrack">
      <span class="trackNoSty">{{ trackNo }}</span>
    </el-button> 
    <span v-else -->
    <span class="trackNoSty"> {{ trackNo }}</span>
  </span>
</template>

<script>
const EXPRESS = 2;
const DEVICE = 1;

export default {
  name: "TrackDescription",
  props: {
    trackType: Number,
    trackNo: String,
    label: {
      type: String,
      default () {
        return "跟踪方式";
      }
    }
  },
  computed: {
    iconName () {
      return this.isDevice ? "dianzihuidan" : "kuaididanhao";
    },
    isDevice () {
      return this.trackType === DEVICE;
    }
  },
  methods: {
    toTrack () {
      // TODO: 跳转到跟踪页面
    }
  }
};
</script>
<style scoped>
.trackNoSty {
  color: var(--prev-color-primary);
  font-size: 16px;
}
</style>